package oo

import (
	"elegantGo/chapter02-1/pkg/validate"
)

type Password struct {
	value string
}

func (o *Password) SetValue(v string) {
	o.value = v
}

func (o *Password) Value() string {
	return o.value
}

func (o *Password) IsValid() bool {
	return validate.Var(o.value, "min=6,max=20") == nil
}
